package com.ejd.web.bo.impl;

import java.io.Serializable;

import javax.faces.application.FacesMessage;

import com.ejd.service.IConsultationTypeService;
import com.ejd.utils.MessageFactory;
import com.ejd.utils.SpringFacesUtil;
import com.ejd.web.bo.AbstractConsultation;
import com.ejd.web.bo.Product;
import com.ejd.web.constant.EjdConstants;
import com.ejd.web.constant.SpringBeanConstants;

public class Consultation extends AbstractConsultation implements Serializable {
	private static final long serialVersionUID = -8106629465344224716L;
	private Customer customer;
	private Reply reply;
	public Customer getCustomer() {
		return customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}
	
	public Reply getReply() {
		return reply;
	}

	public void setReply(Reply reply) {
		this.reply = reply;
	}

	/*public String getStatusCodeDisplay() {
		return statusCodeDisplay;
	}*/
	
	public String getTypeCodeDisplay() {
		if (null == this.getTypeCode()) {
			return "";
			
		} else {
			IConsultationTypeService<ConsultationType,Long> consultationTypeService = (IConsultationTypeService<ConsultationType,Long>)SpringFacesUtil.getSpringBean(SpringBeanConstants.CONSULTATION_TYPE_SERVICE_BEAN_NAME);
			consultationTypeService.setEntityClass(ConsultationType.class);
			consultationTypeService.setPKClass(Long.class);
			ConsultationType consultationType =  consultationTypeService.findUniqueBy("typeCode", this.getTypeCode());
			String consultationTypeNameN18 = MessageFactory.getMessage(EjdConstants.USER_BUNDLE_NAME,consultationType.getTypeName(), FacesMessage.SEVERITY_ERROR).getDetail();
			return consultationTypeNameN18;
		}
	}
	public Consultation(){
		
	}
	
}
